<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <style>
            .error {
                color: #ff0000;
            }
            .errorblock{
                color: #000;
                background-color: #ffEEEE;
                border: 3px solid #ff0000;
                padding:8px;
                margin:16px;
            }

        </style>
    </head>

    <body>
        <h2>Student data's form</h2>

        <form:form method="POST" commandName="studentForm">

            <form:errors path="*" cssClass="errorblock" element="div"/>

            <table>
                <tr>
                    <td>Student Name : </td>
                    <td><form:input path="name" /></td>
                    <td><form:errors path="name" cssClass="error" /></td>
                </tr>

                <tr>
                    <td>Title : </td>
                    <td><form:textarea path="title" /></td>
                    <td><form:errors path="title" cssClass="error" /></td>
                </tr>

                <tr>
                    <td>Supervisor : </td>
                    <td><form:select path="supervisorId">
                            <form:option value="NONE" label="--- Select ---" />
                            <form:options items="${professorList}" itemLabel="name" itemValue="id"/>

                        </form:select></td>

                </tr>

                <tr>
                    <td>Examiner1 : </td>
                    <td><form:select path="examinerId1">
                            <form:option value="NONE" label="--- Select ---" />
                            <form:options items="${professorList}" itemLabel="name" itemValue="id"/>

                        </form:select></td>

                </tr>

                <tr>
                    <td>Examiner2: </td>
                    <td><form:select path="examinerId2">
                            <form:option value="NONE" label="--- Select ---" />
                            <form:options items="${professorList}" itemLabel="name" itemValue="id"/>

                        </form:select></td>

                </tr>

                <tr>
                    <td>President : </td>
                    <td><form:select path="presidentId">
                            <form:option value="NONE" label="--- Select ---" />
                            <form:options items="${professorList}" itemLabel="name" itemValue="id"/>

                        </form:select></td>

                </tr>

                <tr>
                    <td>Secretary : </td>
                    <td><form:select path="secretaryId">
                            <form:option value="NONE" label="--- Select ---" />
                            <form:options items="${professorList}" itemLabel="name" itemValue="id"/>

                        </form:select></td>

                </tr>
                <tr>
                    <td>Additional Member : </td>
                    <td><form:select path="additionalMemberId">
                            <form:option value="NONE" label="--- Select ---" />
                            <form:options items="${professorList}" itemLabel="name" itemValue="id"/>

                        </form:select></td>

                </tr>

                <tr>
                    <td colspan="3"><input type="submit" /></td>
                </tr>
            </table>
        </form:form>
        <br>   <a href="<c:url value="data.htm"/>">Home</a>
        </br>
    </body>
</html>